package com.forgenet.message.base.req;

import java.io.Serializable;

import com.baidu.bjf.remoting.protobuf.*;

import java.util.*;

import com.forgenet.message.base.req.ReqGateLoginPacket;

import com.baidu.bjf.remoting.protobuf.FieldType;

import com.baidu.bjf.remoting.protobuf.utils.*;

import com.google.protobuf.*;

import java.io.IOException;

import java.lang.reflect.*;

import com.baidu.bjf.remoting.protobuf.code.*;


public class ReqGateLoginPacket$$JProtoBufClass implements com.baidu.bjf.remoting.protobuf.Codec<com.forgenet.message.base.req.ReqGateLoginPacket>, Serializable {
	public static final long serialVersionUID = 1L;
    private com.google.protobuf.Descriptors.Descriptor descriptor;

    public byte[] encode(com.forgenet.message.base.req.ReqGateLoginPacket t) throws IOException {
        CodecOutputByteArray output = CodecOutputByteArray.get();
        doWriteTo(t, output.getCodedOutputStream());
        return output.getData();
    }

    public com.forgenet.message.base.req.ReqGateLoginPacket decode(byte[] bb) throws IOException {
        CodedInputStream input = CodedInputStream.newInstance(bb, 0, bb.length);
        return readFrom(input);
    }

    public int size(com.forgenet.message.base.req.ReqGateLoginPacket t) throws IOException {
        int size = 0;
        
        String f_1 = null;
        if (!CodedConstant.isNull(t.getToken())) {
            f_1 = t.getToken();  
            size += com.google.protobuf.CodedOutputStream.computeStringSize(1,f_1);

        }
        
        
        Boolean f_2 = null;
        if (!CodedConstant.isNull(t.isCreateRole())) {
            f_2 = t.isCreateRole();  
            size += com.google.protobuf.CodedOutputStream.computeBoolSize(2,f_2.booleanValue());

        }
        
        
        return size;
    }
 
    public void doWriteTo(com.forgenet.message.base.req.ReqGateLoginPacket t, CodedOutputStream output)
            throws IOException {
         
        String f_1 = null;
        if (!CodedConstant.isNull(t.getToken())) {
            f_1 = t.getToken();
            if (f_1 != null){
output.writeString(1, f_1);
}
  
        }
        
        Boolean f_2 = null;
        if (!CodedConstant.isNull(t.isCreateRole())) {
            f_2 = t.isCreateRole();
            if (f_2 != null){
output.writeBool(2, f_2.booleanValue());
}
  
        }
        
    }            
 
    public void writeTo(com.forgenet.message.base.req.ReqGateLoginPacket t, CodedOutputStream output)
            throws IOException {
        doWriteTo(t, output);
    }
 
    public com.forgenet.message.base.req.ReqGateLoginPacket readFrom(CodedInputStream input) throws IOException {
        com.forgenet.message.base.req.ReqGateLoginPacket ret = new com.forgenet.message.base.req.ReqGateLoginPacket();
        
        

        
        try {
            boolean done = false;
            Codec codec = null;
            while (!done) {
                int tag = input.readTag();
                if (tag == 0) {
                    break;
                }
                
                if (tag == 10) {
                    
                    ret.setToken(input.readString())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 16) {
                    
                    ret.setCreateRole(input.readBool())
;

                    
                    
                    continue;
                }
                
                               
                
                input.skipField(tag);
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e;
        } catch (java.io.IOException e) {
            throw e;
        }

        return ret;       
        
    } 
 
 
     public com.google.protobuf.Descriptors.Descriptor getDescriptor() throws IOException {
        if (this.descriptor != null) {
            return this.descriptor;
        }
        com.google.protobuf.Descriptors.Descriptor descriptor =
                CodedConstant.getDescriptor(com.forgenet.message.base.req.ReqGateLoginPacket.class);
        return (this.descriptor = descriptor);
    }   
}

    